<?php

/**
 * winbinder 패키지 
 * 
 * 
 * @package php.ui.winbinder
 */


/**
 * WBToolBarItem
 *
 * @package php.ui.winbinder
 */
class WBToolBarItem extends WBObject { 

	/**
	 * 생성자  
	 */
	public function __construct($options = array()) { 
		parent::__construct($options);
	}

	public function __destruct() {
		parent::__destruct();
	}
	
	/**
	 * toolbar template 얻어오기 
	 * 
	 * @return unknown_type
	 */
	public function getToolBarTemplate() { 
		return array($this->getOption('id'), null, $this->getOption('tooltip'), $this->getOption('image'));
	}

	protected function initEvent() { 
		parent::initEvent();

		$this->setEvent('click', 'onClick');
	}

	/**
	 * 이벤트 실행 
	 * 
	 * @see WBObject#fire($eo)
	 */
	public function fire($eo) { 
		$this->fireEvent('click', $eo);
	}

	/**
	 * click 이벤트 자동 실행 
	 * 
	 * @param WBEvent $eo
	 */
	public function onClick($eo) {
		if (isset($this->callback)) { 
			call_user_func_array($this->getOption('callback'), array($eo));
		}
	}

}

?>
